<template>
  <div class="install">
    <Vheader title="设置"></Vheader>
    <ul class="box">
      <li @click="openPage('/overPwd')"><span>修改密码</span><span class="iconfont icon-right"></span></li>
      <li @click="openPage('/overTel')"><span>修改绑定手机</span><span class="iconfont icon-right"></span></li>
      <li @click="openPage('/opinion')"><span>意见反馈</span><span class="iconfont icon-right"></span></li>
    </ul>
    <mt-button @click.native="handleClick" type="danger" class="exit">退出登陆</mt-button>
  </div>
</template>

<script>
  import Vheader from '../../components/header.vue'
  export default {
    name: 'install',
    data() {
      return {}
    },
    components: {Vheader},
    mounted: function () {

    },
    methods: {
      handleClick: function () {
        localStorage.removeItem('userToken');
        this.$router.push('/my');
      },
      openPage: function (url) {
        var token=localStorage.getItem('userToken');
        var that=this;
        if(token){
          this.$root.tokenValidat(token,function (result) {
            if(result){
              that.$router.push(url);
            }else{
              that.$router.push('/login');
            }
          })
        }else{
          this.$router.push('/login');
        }
      }
    }
  }
</script>
<style type="text/scss" lang="scss" scoped>
  /*@import "../../common/style/font/iconfont.css";*/
  @import "../../common/style/public";
  .install{
    .box {
      padding: 0 3vw;
      margin-top: 49px;
      background-color: #FFFFFF;
      li {
        display: flex;
        justify-content: space-between;
        height: 46px;
        line-height: 46px;
        border-bottom: 1px solid #f5f5f5;
      }
    }
  }


</style>







